int climbStairs(int n) {
    if (n == 1 || n == 2)
        return n;
    int i = 1, j = 2, sum;
    int count = n - 2;
    while (count--)
    {
        sum = i + j;
        i = j; j = sum;
    }
    return sum;
}